############################ -*- Mode: Makefile -*- ###########################
## Makefile.in --
## ITIID           : $ITI$ $Header $__Header$
## Author          : Ulrich Pfeifer
## Created On      : Tue Mar  8 14:48:35 1994
## Last Modified By: Ulrich Pfeifer
## Last Modified On: Thu Dec 22 15:54:28 1994
## Update Count    : 95
## Status          : Unknown, Use with caution!
###############################################################################
prefix = /usr/local/wais
exec_prefix = $(prefix) 
VPATH = @srcdir@
top_srcdir = @top_srcdir@

           srcdir = @srcdir@
           mandir = @mandir@
               RM = rm -f
           RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut
           CFLAGS = @CFLAGS@
               CC = @CC@
              CPP = @CPP@
               AR = ar cq
           RANLIB = @RANLIB@
             DEFS = @DEFS@
              INC = @INC@ -I. -I$(top_srcdir)/lib -I$(top_srcdir)/ir
             LIBS = @LIBS@ @LIBLOCAL@ ../lib/libftw.a
         CPPFLAGS =
          INSTALL = @INSTALL@
  INSTALL_PROGRAM = @INSTALL_PROGRAM@
     INSTALL_DATA = @INSTALL_DATA@
        REGEXPLIB = @REGEXPLIB@
         LIBLOCAL = @LIBLOCAL@
           bindir = $(exec_prefix)/bin
           libdir = $(exec_prefix)/lib
          LISPDIR = $(libdir)/emacs/lisp

.c.o:
	$(CC) -c $(CPPFLAGS) $(DEFS) $(INC) $(CFLAGS) $<

      CDEBUGFLAGS = -g 

        

          VERSION = 84

# command name for a simple shell interface
     SHELL_UI_CMD = waissearch  
 SHELL_UI_SIG_CMD = waissearch-sig

   SHELL_UTIL_CMD = waisq
    SCREEN_UI_CMD = swais

# For a smaller client, but with no local search,
# use this line this to:
# IR_LIB        = ../bin/client.a


       LOCAL_LIBS =  $(LIBLOCAL) $(REGEXPLIB) 

           IR_LIB = ../ir/libinv.a

          SIG_LIB = ../ir/libsig.a

     PROTOCOL_LIB = ../ir/libwais.a

           UI_LIB = $(IR_LIB)  $(PROTOCOL_LIB) $(LOCAL_LIBS) $(IR_LIB) 

       UI_SIG_LIB = $(SIG_LIB) $(PROTOCOL_LIB) $(LOCAL_LIBS)

          PROTDIR = ../ir
           SRCDIR = ./

#
# Files.
#

# List of source files for saber.

     SHELL_UI_OBJ = waissearch.o
    SCREEN_UI_OBJ = swais.o

all:: $(SHELL_UI_CMD) $(SHELL_UTIL_CMD) $(SCREEN_UI_CMD) wais.el

QUES =  waisq.c

QOBJ =  \
        waisq.o \
        question.o \
        wais-ui.o \
        document.o 

SOBJ =  \
        swais.o \
        question.o \
        wais-ui.o \
        document.o

OBJS =  util.o \
        source.o

SSRC =  swais.c \
        question.c \
        document.c \
        wais-ui.c

QSRC =  waisq.c \
        question.c \
        document.c \
        wais-ui.c

SRC =   util.c \
        source.c


SRCS = $(SSRC) $(QSRC) $(SRC) 

$(IR_LIB):
	(cd ../ir;make libir.a)

$(SIG_LIB):
	(cd ../ir;make libsig.a)

$(PROTOCOL_LIB):
	(cd ../ir;make libwais.a)

$(SHELL_UTIL_CMD): $(QOBJ) $(OBJS) $(UI_LIB) $(LIB)
	$(RM) $@
	$(CC) -o $@ $(QOBJ) $(OBJS) $(LDFLAGS) $(UI_LIB) $(LIBS)  -lm $(RESOLVER)

clean::
	$(RM) $(SHELL_UTIL_CMD) $(SHELL_UI_CMD) $(SCREEN_UI_CMD) wais.el

$(bindir):
	$(srcdir)/../mkinstalldirs $(bindir)
     
$(mandir):
	$(srcdir)/../mkinstalldirs $(mandir)

$(LISPDIR):
	$(srcdir)/../mkinstalldirs $(LISPDIR)

install:: $(SHELL_UTIL_CMD) $(SHELL_UI_CMD) $(SCREEN_UI_CMD) $(bindir) $(LISPDIR)
	$(INSTALL_DATA) wais.el $(LISPDIR)/wais.el
	$(INSTALL_PROGRAM) $(SHELL_UTIL_CMD) $(bindir)/$(binprefix)$(SHELL_UTIL_CMD)
	$(INSTALL_PROGRAM) $(SHELL_UI_CMD) $(bindir)/$(binprefix)$(SHELL_UI_CMD)
	$(INSTALL_PROGRAM) $(SCREEN_UI_CMD) $(bindir)/$(binprefix)$(SCREEN_UI_CMD)

$(SHELL_UI_CMD): $(SHELL_UI_OBJ) $(UI_LIB)
	$(RM) $@
	$(CC) -o $@ $(SHELL_UI_OBJ) $(LDFLAGS) $(UI_LIB) $(LIBS) -lm $(RESOLVER)


$(SCREEN_UI_CMD): $(SOBJ) $(OBJS) $(UI_LIB)
	$(RM) $@
	$(CC) -o $@ $(SOBJ) $(OBJS) $(LDFLAGS) $(UI_LIB) \
                $(LIBS) -lcurses -ltermcap -lm $(RESOLVER)

wais.el:: wais.el.raw
	$(RM) $@
	sed -e s:INSTALLROOT:@INSTALLROOT@:g -e '/^#	*[0-9][0-9]*  *.*$$/d' -e '/^XCOMM$$/s//#/' -e '/^XCOMM[^a-zA-Z0-9_]/s/^XCOMM/#/' wais.el.raw >$@

veryclean:: clean

#$(REGEXPLIB):
#	cd ../regexp; $(MAKE)
#
#$(LIBLOCAL):
#	cd ../ir; $(MAKE)
#
# -------------------------------------------------------------------------
# common rules for all Makefiles - do not edit

emptyrule::

clean::
	$(RM_CMD) "#"*

Makefile::
	-@if [ -f Makefile ]; then set -x; \
	$(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
	else exit 0; fi
	$(IMAKE_CMD) -DTOPDIR = @DTOPDIR@

tags::
	$(TAGS) -w *.[ch]
	$(TAGS) -xw *.[ch] > TAGS

saber:
	# load $(ALLDEFINES) $(SRCS)

osaber:
	# load $(ALLDEFINES) $(OBJS)

# -------------------------------------------------------------------------
# empty rules for directories that do not have SUBDIRS - do not edit

install::
	@echo "install in $(CURRENT_DIR) done"

install.man::
	@echo "install.man in $(CURRENT_DIR) done"

Makefiles::

includes::

# -------------------------------------------------------------------------
